var destoon_userid = {$_userid};
var destoon_username = '{$_username}';
var destoon_message = {$_message};
var destoon_chat = {$_chat};
var destoon_cart = get_cart();
var destoon_member = '';
{if $_userid}
destoon_member += '<span class="f_b" title="{$MG[groupname]}">{$_truename}</span> <a href="{$MODULE[2][linkurl]}line.php" title="{if $_online}在线，点击隐身{else}隐身，点击上线{/if}"><img src="{DT_SKIN}image/user_{if $_online}on{else}off{/if}line.png" width="10" height="10" align="absmiddle"/></a> | <a href="{$MODULE[2][linkurl]}">商务中心</a> | <a href="{$MODULE[2][linkurl]}message.php">站内信(<span class="head_t" id="destoon_message">{if $_message}<strong>{$_message}</strong>{if $_sound}'+sound('message_{$_sound}')+'{/if}{else}0{/if}</span>)</a>{if $DT[im_web]} | <a href="{$MODULE[2][linkurl]}chat.php">新对话(<span class="head_t" id="destoon_chat">{if $_chat}<strong>{$_chat}</strong>'+sound('chat_new')+'{else}0{/if}</span>)</a>{/if} | <a href="{$MODULE[2][linkurl]}logout.php">退出</a>';
{else}
	{if $EXT[oauth]}
	var oauth_site = '{get_cookie('oauth_site')}';
	var oauth_user = '{get_cookie('oauth_user')}';
	destoon_member += (oauth_user && oauth_site) ? '<img src="{DT_PATH}api/oauth/'+oauth_site+'/ico.png" align="absmiddle"/> 欢迎，<strong>'+oauth_user+'</strong> | <a href="{DT_PATH}api/oauth/'+oauth_site+'/index.php?time={$DT_TIME}">绑定帐号</a> | <a href="javascript:" onclick="oauth_logout();">注销登录</a>' : '欢迎，<span class="f_red">客人</span> | <a href="{$MODULE[2][linkurl]}{$DT[file_login]}">请登录</a> | <a href="{$MODULE[2][linkurl]}{$DT[file_register]}">免费注册</a> | <a href="{$MODULE[2][linkurl]}send.php">忘记密码?</a>';
	{else}
	destoon_member += '欢迎，<span class="f_red">客人</span> | <a href="{$MODULE[2][linkurl]}{$DT[file_login]}">请登录</a> | <a href="{$MODULE[2][linkurl]}{$DT[file_register]}">免费注册</a> | <a href="{$MODULE[2][linkurl]}send.php">忘记密码?</a>';
	{/if}
{/if}
$('#destoon_member').html(destoon_member);
{if $DT[city]}
$('#destoon_city').html('{$city_name}');
{/if}
{if isset($MODULE[16])}
$('#destoon_cart').html(destoon_cart > 0 ? '<strong>'+destoon_cart+'</strong>' : 0);
{/if}
{if $_message}
Dnotification('new_message', '{$MODULE[2][linkurl]}message.php', '{useravatar($_username, 'large')}', '站内信 ({$_message})', '收到新的站内信件，点击查看');
{/if}
{if $_chat}
Dnotification('new_chat', '{$MODULE[2][linkurl]}chat.php', '{useravatar($_username, 'large')}', '新对话 ({$_chat})', '收到新的对话请求，点击交谈');
{/if}
{if $_userid && $DT[pushtime]}window.setInterval('PushNew()',{$DT[pushtime]}*1000);{/if}